package com.yc.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yc.entity.Pmap;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * InnoDB free: 4096 kB Mapper 接口
 * </p>
 *
 * @author ly
 * @since 2022-05-25
 */
public interface PmapMapper extends BaseMapper<Pmap> {
    @Select("SELECT * from pmap where ctid=#{ctid} GROUP BY pname;")
    public List< Pmap > queryPname(Integer ctid);

    @Select("SELECT * FROM pmap WHERE pname=#{pname} and cpname = #{cpname} and ctid=#{ctid}")
    public List< Pmap > queryPlayAddress(Integer ctid, @Param("pname") String pname,@Param("cpname") String cpname);

    @Delete("DELETE from pmap WHERE ctid=#{ctid} and pname=#{pname}")
    public Integer deleteByCtidAndPname(Integer ctid,String pname);

    @Delete("DELETE from pmap WHERE ctid=#{ctid}")
    public Integer deleteByCtid(Integer ctid);

    @Select("select * from pmap where pid=#{pid}")
    public List<Pmap> queryByPid(Integer pid);
}
